package zq.cn.baseadapterapp;

import android.app.ListActivity;
import android.os.Bundle;


import java.util.ArrayList;
import java.util.List;
//UI线程中添加数据，与MainAdater关联
public class MainActivity extends ListActivity {
    private List<PicShow> data;
    public void init() {
        data = new ArrayList<PicShow>();
        PicShow p1 = new PicShow(1,R.drawable.women1,"美女1","pic1");
        PicShow p2 = new PicShow(2,R.drawable.women2,"美女2","pic2");
        PicShow p3 = new PicShow(3,R.drawable.women3,"美女3","pic3");
        data.add(p1);
        data.add(p2);
        data.add(p3);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        init();
        MainAdapter mainAdapter = new MainAdapter(this,data);
        setListAdapter(mainAdapter);
    }
}
